/**
 * Author:yuiop
 * Date:2022/8/8 16:26
 */
package com.devops.common;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

import javax.sql.DataSource;

@Component
public class ApplicationTest implements ApplicationContextAware {
    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        DataSource dataSource = applicationContext.getBean(DataSource.class) ;
        System.out.println("----------------------------------");
        System.out.println(dataSource.getClass().getName());
        System.out.println("----------------------------------");
    }
}
